import 'package:flutter/material.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
import 'package:test_app/app/home/home_controller.dart';

import 'package:test_app/core/base/base/base_view.dart';
import 'package:test_app/core/design_system/extensions/extensions.dart';

class HomeView extends BaseView<HomeController> {
  const HomeView({super.key});

  @override
  String? get navTitle => "首页";

  @override
  bool get navBackBtn => false;

  @override
  Widget body() {
    return [
      Text('第一行'),
      Text('第二行').pad(all: 10).backgroundColor(Colors.deepPurple).onTap(controller.openRead),
      TDButton(
        text: '跳转详情',
        type: TDButtonType.fill,
        onTap: () {
          debugPrint('HomeView -> toDetails tapped');
          controller.toDetails();
        },
      ),
      Text('aaaaaaaaaaaa', maxLines: 1, overflow: TextOverflow.ellipsis).size(160, 50).backgroundColor(Colors.amberAccent).border(topRight: 20),
    ].toColumn(spacing: 10.0).padHorizontal(10);
  }
}
